<?php echo $header; ?>
<?php if ($error_warning) { ?>
<div class="warning"><?php echo $error_warning; ?></div>
<?php } ?>
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('view/image/category.png');"><?php echo $heading_title; ?></h1>
    <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
  </div>
  <div class="content">
  <div id="tabs" class="htabs">
  <a tab="#tab_general"><?php echo $tab_general; ?></a>
  </div>
    
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
      <table class="form">
        <tr>
          <td><span class="required">*</span> <?php echo $entry_menuname; ?></td>
          <td><input type="text" name="menuname" value="<?php echo $menuname; ?>" />
            <?php if ($error_menuname) { ?>
            <span class="error"><?php echo $error_menuname; ?></span>
            <?php } ?></td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_pid; ?></td>
          <td>
	          <select name="pid" size="10">
	            <option value="0" selected><?php echo $select_root; ?></option>
	            <?php if ($menus) {?>
          		<?php foreach ($menus as $menu) { ?>
	            <option value="<?php echo $menu['menu_id']; ?>" <?php if ($menu['menu_id'] == $menu_id) {?>selected<?php }?>>
	            &nbsp;&nbsp;&nbsp;
	            <?php 
            		for ($i = 0; $i < $menu['sublevel']; ++$i) {
            	?>
            	&nbsp;&nbsp;
            	<?php }?>
            	<?php if ($menu['sublevel'] != 0) {?>
            	- 
            	<?php }?>
	            <?php echo $menu['menuname']; ?></option>
	            <?php }?>
	            <?php }?>
              </select>
            <?php if ($error_pid) { ?>
            <span class="error"><?php echo $error_pid; ?></span>
            <?php } ?>
            <?php if ($error_pid_match) { ?>
            <span class="error"><?php echo $error_pid_match; ?></span>
            <?php } ?>
            </td>
        </tr>
        <tr>
          <td><span class="required">*</span> <?php echo $entry_ordering; ?></td>
          <td><input type="text" name="ordering" value="<?php echo $ordering; ?>" />
            <?php if ($error_ordering) { ?>
            <span class="error"><?php echo $error_ordering; ?></span>
            <?php } ?></td>
        </tr>
        
        
      </table>
    </form>
  </div>
</div>
<?php echo $footer; ?>